package com.fjwt.gz.proxy.ctrl.activity;

import com.fjwt.gz.core.exception.BizException;
import com.fjwt.gz.core.model.ApiRes;
import com.fjwt.gz.db.dto.ActivityAwardDTO;
import com.fjwt.gz.proxy.ctrl.CommonCtrl;
import com.fjwt.gz.service.impl.ActivityService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@Slf4j
@RestController
@RequestMapping("/api/board")
public class ActivityBoardController extends CommonCtrl {
    @Autowired
    private ActivityService activityService;

    @PostMapping("/exportActivityAward")
    public ApiRes exportActivityAward() {
        ActivityAwardDTO activityAwardDTO = getObject(ActivityAwardDTO.class);
        log.info("机构端导出活动报表，请求地址：/api/realName/exportRealAward，请求参数：fansAuthDTO:{}", activityAwardDTO);
        if (activityAwardDTO ==  null) {
            throw new BizException("请求参数缺失！");
        }
        return activityService.exportReal(activityAwardDTO, getCurrentUser().getSysUser());
    }
}
